package com.eastfair.transport.controller;

import com.eastfair.annotation.annotation.security.PreAuth;
import com.eastfair.core.base.R;
import com.eastfair.transport.service.TransportServiceItemService;
import com.eastfair.venueservice.dto.ServiceItemQuery;
import com.eastfair.venueservice.vo.ServiceItemVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * <p>
 * 前端控制器
 * 服务项
 * </p>
 *
 * @author linan
 * @date 2022-08-01
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/transportServiceItem")
@Api(value = "TransportServiceItem", tags = "服务项")
@PreAuth(replace = "transport:transportServiceItem:")
public class TransportServiceItemController {

    @Resource
    private TransportServiceItemService transportServiceItemService;

    /**
     * 主运准备预订服务的服务列表
     *
     * @param serviceItemQuery 主运准备预订服务的服务列表
     * @return R
     */
    @ApiOperation(value = "主运准备预订服务的服务列表", notes = "主运准备预订服务的服务列表")
    @PostMapping("/queryServiceItemOfTransport")
    public R<List<ServiceItemVO>> queryServiceItemOfTransport(@RequestBody ServiceItemQuery serviceItemQuery) {
        log.info("queryServiceItemOfTransport - 主运准备预订服务的服务列表 serviceItemQuery={}", serviceItemQuery);
        return R.success(transportServiceItemService.queryServiceItemOfTransport(serviceItemQuery));
    }

}
